#!/bin/bash
scriptPath=$(cd $(dirname $0) && pwd)
cd ${scriptPath}

if ! ps aux | grep ngrokd_wdt | grep -v grep | grep -v cron_server_wdt ; then
        if ps aux | grep ngrok | grep -v grep | grep -v cron_server_wdt ; then
                ps aux | grep ngrok | grep -v grep | awk '{print $2}' | xargs kill -9
        fi
        echo "restart cron ngrokd_wdt" >> corn.log
        ./start_server.sh
fi

